<?php include('actions/admin_auth.php') ?>
<?php include('includes/start.php'); ?>

<h2>Add Patron</h2>
<?php 
	if (isset($_GET['err']))  echo "<div id='err'>" . $_GET['err'] . "</div>";
	if (isset($_GET['msg']))  echo "<div id='msg'>" . $_GET['msg'] . "</div>";
?>
<form id='std_padding' action='actions/add_patron.php' method='POST'>
	<table>
		<tr>
			<td>Name: </td><td><input type="text" name="name" /></td>
		</tr>
		<tr>
			<td>Email: </td><td><input type="text" name="email" /></td>
		</tr>
		<tr>
			<td>Password: </td><td><input type="password" name="password" /></td>
		</tr>
		<tr>
			<td>Phone Number: </td><td><input type="text" name="phone_number" /></td>
		</tr>
		<tr>
			<td>City: </td><td><input type="text" name="city" /></td>
		</tr>
		<tr>
			<td>Street: </td><td><input type="text" name="street" /></td>
		</tr>
		<tr>
			<td>Province: </td><td><input type="text" name="province" /></td>
		</tr>
		<tr>
			<td>Postal Code: </td><td><input type="text" name="postal_code" /></td>
		</tr>
		<tr>
			<td>Birth Date: </td><td><input type="text" name="birth_date" /><span id='format'> Format: YYYY-MM-DD</span></td>
		</tr>
		<tr>
			<td>Membership: </td><td> <?php $con = mysql_connect($dbserver, $dbuser, $dbpass);
						mysql_select_db($db, $con);
						$result = mysql_query($memberships_query);
						while ($row = mysql_fetch_array($result))
						{
							echo "<input type=\"radio\" name=\"membership\" value=\"" . $row['membership_type_id'] . "\">" . $row['name'];
						}
						mysql_close($con); ?></td>
		</tr>
		<tr>
			<td colspan='2'>&nbsp;&nbsp<input type="submit" value="Add" />&nbsp;&nbsp;<input type="reset" value="Clear" /></td>
		</tr>
	</table>
</form>

<?php include('includes/stop.php'); ?>
